package photo.managerv0;

import java.util.ArrayList;
import java.util.List;

public class Picbank {

	public java.util.List<Album> getAllalbum(String path){
		java.util.List<Album> alist=new java.util.ArrayList();
		FindFile ff=new FindFile();
		List<String> list1=new ArrayList();
		list1=ff.findDir(path);
		for(int i=1;i<=list1.size();i++){
			Album a=new Album(i,list1.get(i-1));
			a.setPhotos(getAllPhoto(list1.get(i-1)));
			alist.add(a);
		}
		return alist;
	}
	private java.util.List<Photo> getAllPhoto(String path){
		java.util.List<Photo> plist=new java.util.ArrayList();
		FindFile ff=new FindFile();
		List<String> list2=new ArrayList();
		list2=ff.findPic(path);
		for(int i=1;i<=list2.size();i++){
			Photo p=new Photo(i,list2.get(i-1),list2.get(i-1));
			plist.add(p);
		}
		return plist;
	}

}
